Skip to content

[SYCLomatic] Add explicit cast if CUDA enum type is migrated scoped type and the value is compared to a different type value.#2829

Merged
zhimingwang36 merged 9 commits into
oneapi-src:SYCLomaticfrom
ShengchenJ:add_op_val
May 28, 2025
Merged

[SYCLomatic] Add explicit cast if CUDA enum type is migrated scoped type and the value is compared to a different type value.#2829
zhimingwang36 merged 9 commits into
oneapi-src:SYCLomaticfrom
ShengchenJ:add_op_val

Conversation

@ShengchenJ

Copy link
Copy Markdown
Contributor

No description provided.

Signed-off-by: Chen, Sheng S <sheng.s.chen@intel.com>
@ShengchenJ ShengchenJ requested a review from a team as a code owner May 13, 2025 06:10
@ShengchenJ ShengchenJ requested review from intwanghao and zhiweij1 May 13, 2025 06:10
Signed-off-by: Chen, Sheng S <sheng.s.chen@intel.com>
Signed-off-by: Chen, Sheng S <sheng.s.chen@intel.com>
Comment thread clang/lib/DPCT/ASTTraversal.cpp Outdated
@zhimingwang36 zhimingwang36 changed the title [SYCLomatic] Cast the CUDA enum type to int if the type is scoped. [SYCLomatic] Add explicit cast if CUDA enum type is migrated scoped type and the value is compared to a different type value. May 15, 2025
@ShengchenJ ShengchenJ requested a review from Copilot May 16, 2025 01:43

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds a new migration rule to handle explicit cast insertion for CUDA enum type comparisons and registers it in the AST traversal. The key changes include:

  • Introducing BinaryOperatorCallRule in the header and implementation files.
  • Inserting explicit cast replacements for certain enum values.
  • Registering the new rule in the AST traversal.

Reviewed Changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated 1 comment.

File Description
clang/lib/DPCT/RulesLang/RulesLang.h Added declaration for BinaryOperatorCallRule.
clang/lib/DPCT/RulesLang/RulesLang.cpp Implemented BinaryOperatorCallRule with cast logic.
clang/lib/DPCT/ASTTraversal.cpp Registered BinaryOperatorCallRule.
Files not reviewed (1)
  • clang/test/dpct/enum_type.cu: Language not supported

Comment thread clang/lib/DPCT/RulesLang/RulesLang.cpp Outdated
Signed-off-by: Chen, Sheng S <sheng.s.chen@intel.com>
Comment thread clang/lib/DPCT/RulesLang/RulesLang.cpp Outdated
Signed-off-by: Chen, Sheng S <sheng.s.chen@intel.com>
Signed-off-by: Chen, Sheng S <sheng.s.chen@intel.com>
Signed-off-by: Chen, Sheng S <sheng.s.chen@intel.com>
Signed-off-by: Chen, Sheng S <sheng.s.chen@intel.com>
Comment thread clang/test/dpct/enum_type.cu Outdated
Signed-off-by: Chen, Sheng S <sheng.s.chen@intel.com>
@zhimingwang36 zhimingwang36 merged commit 7d3f6e9 into oneapi-src:SYCLomatic May 28, 2025
1 check passed
@ShengchenJ ShengchenJ deleted the add_op_val branch May 28, 2025 08:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants